package tw.com.book;

import java.util.List;

import org.apache.commons.lang3.SerializationUtils;

import tw.com.book.domain.V001Type;

import com.parse.FindCallback;
import com.parse.ParseException;
import com.parse.ParseFile;
import com.parse.ParseObject;
import com.parse.ParseQuery;

import android.app.Activity;
import android.os.Bundle;

/**
 * 設定
 * 
 * @author Andy
 * 
 */
public class SettingActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
	}

	/**
	 * 備份
	 */
	public void backup() {

	}

	/**
	 * 忘記密碼
	 */
	public void forgetPassword() {

	}

	/**
	 * 同步
	 */
	public void recover() {

	}

	public void downloadFromPaser() {
		ParseQuery<ParseObject> query = ParseQuery.getQuery("jobAppliction");
		query.findInBackground(new FindCallback<ParseObject>() {

			@Override
			public void done(List<ParseObject> arg0, ParseException arg1) {

				for (ParseObject obj : arg0) {
					ParseFile file = obj.getParseFile("file");
					try {

						V001Type type = SerializationUtils.deserialize(file
								.getData());
						toString();
					} catch (ParseException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}
				}
				// TODO Auto-generated method stub

			}
		});
	}

}
